package org.apache.flink.runtime.entrypoint.master;

import java.util.concurrent.Executor;

import org.apache.flink.api.common.ConsumerID;
import org.apache.flink.configuration.Configuration;
import org.apache.flink.runtime.blob.BlobServer;
import org.apache.flink.runtime.clusterframework.types.ResourceID;
import org.apache.flink.runtime.heartbeat.HeartbeatServices;
import org.apache.flink.runtime.highavailability.HighAvailabilityServices;
import org.apache.flink.runtime.metrics.MetricRegistry;
import org.apache.flink.runtime.rpc.FatalErrorHandler;
import org.apache.flink.runtime.rpc.RpcService;
import org.apache.flink.runtime.rpc.retriever.MetricQueryServiceRetriever;

/**
 * @类名: MasterComponentFactory
 * @说明: master组件工厂
 *        包括资源消费者，资源管理器，
 *        及用户通过该接口实现提供的构建其他组件，如调度器，任务等
 *
 * @author   leehom
 * @Date	 2023年10月25日 上午9:02:56
 * 修改记录：
 *
 * @see 	 
 */
public interface MasterComponentFactory {

	MasterComponentOperations create(
    		ConsumerID consumerId,
    		String consumerName,
            Configuration configuration,
            ResourceID resourceId, // 资源管理器资源Id
            Executor ioExecutor, // 
            RpcService rpcService,  // rpc
            HighAvailabilityServices highAvailabilityServices, // ha服务工厂
            BlobServer blobServer,
            HeartbeatServices heartbeatServices, // 心跳
            MetricRegistry metricRegistry, // metrics注册器
            MetricQueryServiceRetriever metricQueryServiceRetriever, // metrics查询服务网关获取器
            FatalErrorHandler fatalErrorHandler)
            throws Exception;
}
